<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h3>
            {{ fnCount() }}
        </h3>

        <div>
            {{ fnCount() }}
        </div>

        <p>
            {{ fnCount() }}
        </p>

        <div>
            <input v-model="count" type="text">
        </div>
    </div>


    <script src="./js/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                count: 100
            },
            // 计算属性   缓存
            //  依赖项(data中的数据)不发生改变的话，就不会重新进行计算
            computed: {
                newCount() {
                    console.log('我执行了')
                    return this.count + 1
                }
            },
            methods: {
                fnCount() {
                    console.log('我是函数')
                    return this.count + 1
                }
            },
            created() {
            //    console.log(this.newCount) 
            }
        })
    </script>
</body>
</html>